//
//  Language.h
//
//  Created by cktim852 on 21/03/2010.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

// timeout error code
#define error_code_p001                 @"P001"

// generic error code
#define error_code_p002                 @"P002"

// untrusted error code
#define error_code_p0020                @"P0020"

// time out default value
#define http_con_default_timeout        60.0
// Const variables of http connection tag ID.
extern NSString * const kGSPProxyConnectTag;
extern NSString * const kMultipleGSPProxyConnectTag;
/* WDT enhancement start */
@class HTTPConnectionUtility;
/* WDT enhancement end */




@interface HTTPConnectionUtility : NSObject <NSURLConnectionDataDelegate>
{
	NSURLConnection                                             *httpConnection;
    NSMutableData                                               *receivedData;
    NSURLAuthenticationChallenge                                *currentChallenge;
    
    NSTimer                                                     *timeoutCounter;
    NSTimeInterval                                              timeoutValue;
    
    NSString                                                    *tagId;
    NSString                                                    *taskId;
    NSString                                                    *callback;
    
    //Function SSL Pinning Country Configuration
    //Start:by Winger Ye 2015-06-21
    BOOL                                                        alwaysValidateSSLPinning;
    //End
    
    long long                                                   expectedContentLength;
}

@property (nonatomic, retain) NSURLConnection                   *httpConnection;
@property (nonatomic, retain) NSMutableData                     *receivedData;
@property (nonatomic, retain) NSURLAuthenticationChallenge      *currentChallenge;
@property (nonatomic, retain) NSTimer                           *timeoutCounter;

//Function SSL Pinning Country Configuration
//Start:by Winger Ye 2015-06-21
@property (nonatomic, assign) BOOL                              alwaysValidateSSLPinning;
//End

@property (copy)              NSString                          *tagId;
@property (copy)              NSString                          *taskId;
@property (copy)              NSString                          *callback;

@property (nonatomic, assign) long long                         expectedContentLength;


// data common util methods
+ (NSString *)encodeURL:(NSString *)string;
// 2013-12-19, Nathan, Core Enhancement for HSBCNet -start
+ (NSString *)normalizeRequestParametersInfo:(NSDictionary *)requestParametersInfo;
+ (NSMutableURLRequest*)createFormRequestWithURLString:(NSString*)urlpath
                                 requestParametersInfo:(NSDictionary*)requestParametersInfo
                                         requestMethod:(NSString*)method
                                        needHSBCHeader:(BOOL)needHSBCHeader;
// 2013-12-19, Nathan, Core Enhancement for HSBCNet -end
@end
